﻿using System;

namespace Progream24
{
    class Program
    {
        static void Main(string[] args)
        {
            var num1 = 10;
            var num2 = 20;
            Console.WriteLine("num1为{0},num2为{1}",num1,num2);

            Swap(ref num1, ref num2);
            Console.WriteLine("交换后");
            Console.WriteLine("num1为{0},num2为{1}", num1, num2);

        }
        public static void Swap(ref int x,ref int y)
        {
            var tmp= x;
            x = y;
            y = tmp;
        }
    }
}
